﻿using Dapper_Core.Model;
using Dapper_Core.Table;
using System;
using System.Collections.Generic;
using System.Text;

namespace Dapper_Core.BLL.Interface
{
    public interface ISys_MenuBusiness
    {
        /// <summary>
        /// 检查系统资源是否存在
        /// </summary>
        /// <param name="menuCode">资源Code</param>
        /// <param name="menuCode">资源主键</param>
        /// <returns></returns>
        bool IsExist(string menuCode, string menuId = "");

        /// <summary>
        /// 软删除系统资源
        /// </summary>
        /// <param name="ids">系统资源主键，多个主键以逗号隔开</param>
        /// <param name="deleter">删除人</param>
        /// <returns></returns>
        bool Delete(string ids, string deleter);

        /// <summary>
        /// 根据条件获取增强版的系统资源(包括：菜单、按钮)，增加的内容：MenuTypeName、VirtualParentCode
        /// </summary>
        /// <param name="search">查询条件</param>
        /// <returns></returns>
        List<Sys_MenuExtend> GetExtendMenuList(string search);

        /// <summary>
        /// 获取当前登陆者所拥有资源的PageUrl
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <param name="roleCode">角色编码</param>
        /// <returns></returns>
        List<string> GetAllMenuPageUrls(string userCode, string roleCode);

        /// <summary>
        /// 获取用户所拥有资源的PageUrl
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <returns></returns>
        List<string> GetAllMenuPageUrlsByUser(string userCode);

        /// <summary>
        /// 获取角色所拥有资源的PageUrl
        /// </summary>
        /// <param name="roleCode">角色编码</param>
        /// <returns></returns>
        List<string> GetAllMenuPageUrlsByRole(string roleCode);

        /// <summary>
        /// 获取当前登陆者所拥有资源的Code
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <param name="roleCode">角色编码</param>
        /// <returns></returns>
        List<string> GetAllMenusCode(string userCode, string roleCode);

        /// <summary>
        /// 获取用户所拥有资源的Code
        /// </summary>
        /// <param name="userCode">用户编码</param>
        /// <returns></returns>
        List<string> GetAllMenusCodeByUser(string userCode);

        /// <summary>
        /// 获取角色所拥有资源的Code
        /// </summary>
        /// <param name="roleCode">角色编码</param>
        /// <returns></returns>
        List<string> GetAllMenusCodeByRole(string roleCode);
    }
}